const {RSAKey} = require("node-jsencrypt")
var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var b64pad="=";
function hex2b64(h) {
    var i;
    var c;
    var ret = "";
    for (i = 0; i + 3 <= h.length; i += 3) {
        c = parseInt(h.substring(i, i + 3), 16);
        ret += b64map.charAt(c >> 6) + b64map.charAt(c & 63);
    }
    if (i + 1 == h.length) {
        c = parseInt(h.substring(i, i + 1), 16);
        ret += b64map.charAt(c << 2);
    } else if (i + 2 == h.length) {
        c = parseInt(h.substring(i, i + 2), 16);
        ret += b64map.charAt(c >> 2) + b64map.charAt((c & 3) << 4);
    }
    while ((ret.length & 3) > 0) ret += b64pad;
    return ret;
}

function result() {
    var rsaKey = new RSAKey();
    rsaKey.setPublic('008a72061adcfed8f27a1c1c46dce9c60a1d55a3a703a0ec7cad8ef1305b063ede51818de28456ffb8859399efad8b4aad01494fa6ee2f99d63f1e077c66ac27dd8360b34d96a55aa66ef4cb3faa386a6fc8c17e4ae57eda5e0b37421b3dcd4760d59a907bbe99e1dff2474f3cf4da9308a19688d36f164becf0b87b6a49c354ab', '010001')
    enpassword = rsaKey.encrypt("123456")
    return hex2b64(enpassword)
}

console.log(result())